﻿package main

import "fmt"

func factorization(n int) (res []int){
    for i := 1; i <= n/2; i++ {
        if n % i == 0 {
            res = append(res, i)
        }
    }
    return
}

func sum(s []int) int {
    var res int = 0
    for i := 0; i < len(s); i++ {
        res += s[i]
    }
    return res
}

func find_number(n int){
    for i:= 1; i <= n; i++ {
        fmt.Printf("正在计算：%d\r", i)
        factors := factorization(i)
        sum := sum(factors)
        if sum == i {
            fmt.Println(i, "         ")
        }
    }
}

func main(){
    find_number(33550336)
}